using System.ComponentModel.DataAnnotations;
using SqlSugar;

namespace TradeFlow.Server.Models;

/// <summary>
/// 业务单表体信息
/// </summary>
[SugarTable(nameof(JxBillList), "业务单表体信息")]
public class JxBillList : EntityBase
{
    /// <summary>
    /// 表头ID
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "表头ID")]
    public long HeadId { get; set; }

    /// <summary>
    /// 序号
    /// </summary>
    [Required]
    [SugarColumn(ColumnDescription = "序号")]
    public int SeqNo { get; set; }

    /// <summary>
    /// 商品编码
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "商品编码")]
    public string Code { get; set; }

    /// <summary>
    /// 商品名称
    /// </summary>
    [Required, MaxLength(200)]
    [SugarColumn(ColumnDescription = "商品名称")]
    public string Name { get; set; }

    /// <summary>
    /// 商品类别
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "商品类别")]
    public string Category { get; set; }

    /// <summary>
    /// 规格型号
    /// </summary>
    [MaxLength(500)]
    [SugarColumn(ColumnDescription = "规格型号", IsNullable = true)]
    public string Model { get; set; }

    /// <summary>
    /// 产地
    /// </summary>
    [MaxLength(50)]
    [SugarColumn(ColumnDescription = "产地", IsNullable = true)]
    public string Producer { get; set; }

    /// <summary>
    /// 计量单位
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "计量单位")]
    public string Unit { get; set; }

    /// <summary>
    /// 数量
    /// </summary>
    [Required]
    [SugarColumn(ColumnDescription = "数量")]
    public int? Qty { get; set; }

    /// <summary>
    /// 单价
    /// </summary>
    [SugarColumn(ColumnDescription = "单价", IsNullable = true, ColumnDataType = "decimal(18,2)")]
    public decimal? Price { get; set; }

    /// <summary>
    /// 金额
    /// </summary>
    [SugarColumn(ColumnDescription = "金额", IsNullable = true, ColumnDataType = "decimal(18,2)")]
    public decimal? Amount { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [SugarColumn(ColumnDescription = "备注", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
    public string Note { get; set; }
}